


import sys
from PyQt5 import QtWidgets
from MyCreateBlock import Ui_Form                  # MyCreateBlock是ui文件转换的py文件的名字
from PyQt5.QtWidgets import QMessageBox

class MyPyQT_Form(QtWidgets.QWidget,Ui_Form):      # MyPyQT_Formsh是个新类名，自定义即可
    def __init__(self):
        super(MyPyQT_Form,self).__init__()
        self.setupUi(self)

        # 绑定信号与槽
        self.btn_cteate.clicked.connect(self.bth_create_click)


    # 定义函数
    def bth_create_click(self):
        print("棒棒棒")
        reply = QMessageBox.information(self, '提示', '这是一个消息提示对话框!', QMessageBox.Ok | QMessageBox.Close,QMessageBox.Close)





# if __name__ == '__main__':
#     app = QtWidgets.QApplication(sys.argv)
#     my_pyqt_form = MyPyQT_Form()
#     my_pyqt_form.show()
#     sys.exit(app.exec_())


app = QtWidgets.QApplication(sys.argv)
my_pyqt_form = MyPyQT_Form()
my_pyqt_form.show()
sys.exit(app.exec_())